import gtk, gobject
#########
#from pynicotine.utils import _
# fake translation function
def _(s):
	return s
##########

class window1:
    def __init__(self, create = True, accel_group = None, tooltips = None):
        if accel_group is None:
             self.accel_group = gtk.AccelGroup()
        else:
             self.accel_group = accel_group
        if tooltips is None:
             self.tooltips = gtk.Tooltips()
        else:
             self.tooltips = tooltips
        self.tooltips.enable()
        if create:
            self.window1 = gtk.Window()
            self.window1.set_title(_("PyTombo"))
            self.window1.add_accel_group(self.accel_group)

        self.vbox1 = gtk.VBox(False, 0)
        self.vbox1.show()

        self.menubar1 = gtk.MenuBar()
        self.menubar1.show()

        self.menuitem1 = gtk.MenuItem(_("_File"))
        self.menuitem1.show()

        self.menu1 = gtk.Menu()
        self.menu1.show()

        self.imagemenuitem1 = gtk.ImageMenuItem(_("gtk-new"))
        self.imagemenuitem1.show()

        self.menu1.append(self.imagemenuitem1)

        self.imagemenuitem2 = gtk.ImageMenuItem(_("gtk-open"))
        self.imagemenuitem2.show()

        self.menu1.append(self.imagemenuitem2)

        self.imagemenuitem3 = gtk.ImageMenuItem(_("gtk-save"))
        self.imagemenuitem3.show()

        self.menu1.append(self.imagemenuitem3)

        self.imagemenuitem4 = gtk.ImageMenuItem(_("gtk-save-as"))
        self.imagemenuitem4.show()

        self.menu1.append(self.imagemenuitem4)

        self.separatormenuitem1 = gtk.MenuItem()
        self.separatormenuitem1.show()

        self.menu1.append(self.separatormenuitem1)

        self.imagemenuitem5 = gtk.ImageMenuItem(_("gtk-quit"))
        self.imagemenuitem5.show()

        self.menu1.append(self.imagemenuitem5)

        self.menuitem1.set_submenu(self.menu1)

        self.menubar1.append(self.menuitem1)

        self.menuitem2 = gtk.MenuItem(_("_Edit"))
        self.menuitem2.show()

        self.menu2 = gtk.Menu()
        self.menu2.show()

        self.imagemenuitem6 = gtk.ImageMenuItem(_("gtk-cut"))
        self.imagemenuitem6.show()

        self.menu2.append(self.imagemenuitem6)

        self.imagemenuitem7 = gtk.ImageMenuItem(_("gtk-copy"))
        self.imagemenuitem7.show()

        self.menu2.append(self.imagemenuitem7)

        self.imagemenuitem8 = gtk.ImageMenuItem(_("gtk-paste"))
        self.imagemenuitem8.show()

        self.menu2.append(self.imagemenuitem8)

        self.imagemenuitem9 = gtk.ImageMenuItem(_("gtk-delete"))
        self.imagemenuitem9.show()

        self.menu2.append(self.imagemenuitem9)

        self.menuitem2.set_submenu(self.menu2)

        self.menubar1.append(self.menuitem2)

        self.menuitem3 = gtk.MenuItem(_("_View"))
        self.menuitem3.show()

        self.menubar1.append(self.menuitem3)

        self.menuitem4 = gtk.MenuItem(_("_Help"))
        self.menuitem4.show()

        self.menu3 = gtk.Menu()
        self.menu3.show()

        self.imagemenuitem10 = gtk.ImageMenuItem(_("gtk-about"))
        self.imagemenuitem10.show()

        self.menu3.append(self.imagemenuitem10)

        self.menuitem4.set_submenu(self.menu3)

        self.menubar1.append(self.menuitem4)

        self.vbox1.pack_start(self.menubar1, False, True, 0)

        ######### TODO Need toolbar support :-)
        #self.vbox1.pack_start(self.toolbar1, False, True, 0)

        self.hbox2 = gtk.HBox(False, 0)
        self.hbox2.show()
        self.hbox2.set_spacing(4)
        self.hbox2.set_border_width(1)

        self.scrolledwindow2 = gtk.ScrolledWindow()
        self.scrolledwindow2.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.scrolledwindow2.show()

        self.tree_notes = gtk.TreeView()
        self.tree_notes.show()
        self.tree_notes.connect("row_activated", self.on_tree_notes_row_activated)
        self.scrolledwindow2.add(self.tree_notes)

        self.hbox2.pack_start(self.scrolledwindow2)

        self.scrolledwindow1 = gtk.ScrolledWindow()
        self.scrolledwindow1.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.scrolledwindow1.show()

        self.text_note = gtk.TextView()
        self.text_note.show()
        self.scrolledwindow1.add(self.text_note)

        self.hbox2.pack_start(self.scrolledwindow1)

        self.vbox1.pack_start(self.hbox2)


        if create:
            self.window1.add(self.vbox1)

    def on_tree_notes_row_activated(self, widget):
        pass

    def get_custom_widget(self, id, string1, string2, int1, int2):
        w = gtk.Label(_("(custom widget: %s)") % id)
        return w

